#ifndef CONFIG_TEST_H
#define CONFIG_TEST_H

#include "include/gtest.h"
#include "../Tool/include/Variant.h"
#include "../Tool/include/ConfigIni.h"
#include "../Tool/include/ConfigJson.h"
#include "../Tool/include/ILogger.h"
using namespace Tool;

TEST(Config, Configconfigini)
{
    ConfigIni configini;
    configini.Load("config1.ini");
    Variant &config = configini.GetConfig();
    config["Setting"]["size"] = 100;
    config["Setting"]["output"] = true;
    config["Setting"]["log"] = "hellow";
    config["Setting"]["time"] = 101.12;
    configini.Save("config1.ini");
    LOG_INFO("%s", config["Setting"]["log"].ToString().c_str());

    //json配置文件读取，存储，使用
    ConfigJson configjson;
    configjson.Load("config.json");
    Variant &config1 = configjson.GetConfig();
    config1["Setting"]["size"] = 100;
    config1["Setting"]["output"] = true;
    config1["Setting"]["log"] = "hellow";
    config1["Setting"]["time"] = 101.12;
    configjson.Save("config.json");
    LOG_INFO("ConfigJson %s", config1["Setting"]["log"].ToString().c_str());
}

#endif // CONFIG_TEST_H
